<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title>{$Think.lang.project_title}</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="INDEX/css/mui.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="INDEX/css/main.css"/>.
    <link rel="stylesheet" type="text/css" href="INDEX/css/login.css"/>

    <style>
        .mui-switch-handle{text-align: center;line-height: 27px;}
        .mui-switch-handle span{ font-size: 14px;   color:#d3c7a5}
    </style>
</head>

<body>
<script src="INDEX/js/mui.min.js"></script>

<script type="text/javascript">
    mui.init()
</script>
<header class="mui-bar mui-bar-nav">
    <div class="mui-switch mui-pull-right {if $think_var=='zh-cn'}mui-active{/if}" id="mySwitch" >
        <div class="mui-switch-handle"><span>{if $think_var=='zh-cn'}en{else}中{/if}</span></div>
    </div>
    <h1 class="mui-title">{$Think.lang.project_title}</h1>
</header>
<div class="login_content">
    <div class="login_title" style="padding-top:44px ;">
        <h2>{$Think.lang.project_title}</h2>
    </div>
    <div class="login_user">
        <div class="user_name">
            <span class="user_img"></span>
            <input type="text" name="username" id="username" placeholder="{$Think.lang.username}"/>
        </div>
        <div class="user_pwd mui-input-row mui-password">
            <span class="user_pwd_img" style="background: url('INDEX/images/img/icon_password_hiden.png') no-repeat;background-size: 80%; margin-left: 3px;"></span>
            <input type="password" name="password" id="password" class="mui-input-password" placeholder="{$Think.lang.password}"/>
        </div>
    </div>
    <div class="login_now">{$Think.lang.toLogin}</div>
    <a href="{:Url('index/login/forget')}"><div class="forgot" style="color: #CBAB6F;">{$Think.lang.foget_pwd}</div></a>
</div>
</body>
<script src="INDEX/js/switchover.js"></script>
<script src="INDEX/js/jquery-1.8.0.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $(document).ready(function(){
        var width=$(document).width();
        var height=$(window).height();
        $(".login_content").css({"background":"url(INDEX/images/img/img_sign_in_bg.png) center no-repeat","width":width,"height":height,"background-size":"cover"});

        $(".login_now").click(function (){
            var username = $('#username').val();
            var password = $('#password').val();
            if(username=="")
            {
                mui.toast("{$Think.lang.empty_username}");
                return false;
            }
            if(password=="")
            {
                mui.toast("{$Think.lang.empty_password}")
                return false;
            }
            $.post("{:Url('Login/login')}", {
                "username" : username,
                "password" : password,
            }, function(data) {
                if (data['code'] == 0) {
                    //$(".sub_login").attr("disabled", "disabled");
                    window.location.href = "{:Url('Index/index')}";
                } else {
                    mui.toast(data["message"])
                }
            });
        });



    })
</script>
</html>